<?php


namespace app\controllers\Project_1_0;

use Core\Controller;
class Add extends Controller
{
    function __construct()
    {
        parent::__construct();
        //判断是否登陆过
        if (!isset($_SESSION['user'])){
            $this->error("您尚未登录","index.php?action=user&func=login");
            exit();
        }
    }
    function addStatic(){
        $this->diplay("add/add");
    }
    function index(){
        //获取页面上传过来的值
        $c_id = $_POST['c_id'];
        $Name = $_POST['Name'];
        $dealer = $_POST['dealer'];
        $receive_date = $_POST['receive_date'];
        $finish_date = $_POST['finish_date'];
        $except_date = $_POST['except_date'];
        $status = $_POST['status'];
        $model = new \app\models\Project_1_0\Add();
        $res = $model->newAdd($c_id,$Name,$dealer,$receive_date,$finish_date,$except_date,$status);
        $this->success("添加成功","index.php?action=cases&func=index");
    }

}